/* -----------------------------------------------------------------------------
 * PROJECT    : net.lwf
 * FILE       : fVowelFamilyAction.java
 *
 * HISTORY:
 * Date          Author                        Description
 * ----------------------------------------------------------------------------- 
 * Jan 13, 2009       Raghu Sarraff			       Created
 */
package lwf.web.struts.action.word;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import lwf.handler.IProcessHandler;
import lwf.handler.english.word.VowelFamilyHandler;
import lwf.web.struts.action.BaseAction;
import lwf.web.struts.action.form.english.VowelFamilyActionForm;

import net.lwf.web.constant.IPageTitle;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;


//public class VowelFamilyAction extends DispatchAction {
public class VowelFamilyAction extends BaseAction {
	public ActionForward home(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		VowelFamilyActionForm vfaf = (VowelFamilyActionForm) form;
		return mapping.findForward("home");
	} //home
	
	public ActionForward display(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
        String vowel = (String) request.getParameter("vowel");
        String voweltype = (String) request.getParameter("voweltype");
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		out.println(VowelFamilyHandler.getDisplayData(vowel, voweltype));
		out.flush();

		return null; // Not forwarding to anywhere, response is fully-cooked
	} //display

	@Override
	public IProcessHandler getHandler(HttpServletRequest request) {
		return null;
	}
	
	@Override
	public String getPageTitle() {
		return IPageTitle.VOWEL_FAMILY;
	}

	@Override
	public String getMainTitle() {
		return null;
	}

	@Override
	public String getPdfLink() {
		return null;
	}

	@Override
	public String getQuizLink() {
		return null;
	}
	
} //VowelFamilyAction

